<div class="form">
<?php $form = $this
	->beginWidget('CActiveForm',
		array(
			'id' => 'company-certificate-form',
			'enableAjaxValidation' => false,
			'htmlOptions' => array(
				'enctype' => 'multipart/form-data'
			)
		));
?>

<!-- 	<p class="note">Fields with <span class="required">*</span> are required.</p> -->

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model, 'name'); ?>
		<?php echo $form->textField($model, 'name', array(
				'size' => 60,
				'maxlength' => 255
			)); ?>
		<?php echo $form->error($model, 'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'grantDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'grantDate',
				));
		?>
		<?php echo $form->error($model, 'grantDate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'verifyDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'verifyDate',
				));
		?>
		<?php echo $form->error($model, 'verifyDate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'extendDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'extendDate',
				));
		?>
		<?php echo $form->error($model, 'extendDate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'expireDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'expireDate',
				));
		?>
		<?php echo $form->error($model, 'expireDate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'previewImage'); ?>
		<?php if ($model->previewThumb) {
			echo CHtml::link(
				CHtml::image(
					Yii::app()->baseUrl . '/uploads/companyCertificate/tn/' . $model->previewThumb),
				Yii::app()->baseUrl . '/uploads/companyCertificate/' . $model->previewImage,
				array(
					'target' => '_blank'
				));
		}
		?>
		<?php echo $form->fileField($model, 'previewImage'); ?>
		<?php echo $form->error($model, 'previewImage'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'note'); ?>
		<?php echo $form->textArea($model, 'note', array(
				'rows' => 6,
				'cols' => 50
			)); ?>
		<?php echo $form->error($model, 'note'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '新建' : '保存'); ?>
	</div>
<?php $this->endWidget(); ?>

</div><!-- form -->
